<? include_once("header_common.phtml");?>
    <body>
        <div class="container">
            <div id="header" class="span-24 last header">
                <div class="span-4"><a href="/" title="segundamanita.com home"><img src="/images/segundito.png" alt="segundito" id="logo" /></a></div>
                <div class="prepend-top span-14">
                    <div class="site-name"><a href="/" title="segundamanita.com home"><img src="/images/segundamanita_logo.png" alt="segundamanita.com" id="marca" /></a></div>
                    <div class='site-slogan'><?= $this->translate('slogan') ?></div>
                </div>
                <div class="right span-6 last user_login_box">
                    <?php
                    //search form
                    require_once APPLICATION_PATH . '/forms/Search.php';
                    $form = new Form_Search( );

                    $form->setAction('/' . $this->lang . '/search/');
                    $form->loadDefaultDecoratorsIsDisabled(false);
                    foreach ($form->getElements() as $element) {
                        $element->removeDecorator('DtDdWrapper');
                        $element->removeDecorator('Label');
                    }
                    echo $form;

                    $auth = Zend_Auth::getInstance ();
                    if (!$auth->hasIdentity()) {
                        echo '<a class="loginbox" href="/' . $this->lang . '/user/register">' . $this->translate('New user') . '</a> ';
                        echo '<img src="/images/division_loginbox.jpg" alt="login" id="division_loginbox" />';
                        echo ' <a class="loginbox" href="/' . $this->lang . '/auth/login">' . $this->translate('Login') . '</a>';
                    
                    } else {

                        $auth_username = $auth->getIdentity()->username;
                        $auth_userid = $auth->getIdentity()->id;

                        echo '<span class="hello">'.$this->translate('Hello,') . '&nbsp;<a class="loginbox" href="/' .
                        $this->lang . '/profile/' . $this->escape($auth_username) . '">' . $this->escape($auth_username) . '</a></span> ';
                        echo '<img src="/images/division_loginbox.jpg" alt="login" id="division_loginbox" />';
                        //check messages
                        // if ( $this->checkMessages > 0) {
                        echo '<a class="loginbox" title="' . $this->translate('new messages') . '" href="/' . $this->lang . '/message/received">
                            <img src="/images/icons/ico_email.png" />&nbsp;' . $this->checkMessages . '</a> ';
                        //}
                        echo '<img src="/images/division_loginbox.jpg" alt="login" id="division_loginbox" />';
                        echo'<a class="loginbox" href="/' . $this->lang . '/auth/logout">' .
                        $this->translate('Logout') . '</a>';
                    }
                    ?>
                </div>
                
                <div class="sociallinks">
                    <a target="_blank" href="http://www.facebook.com/Segundamanita"><img alt="<?=$this->translate('Share on facebook');?>" src="/images/icons/ico_facebook.png" border = "0"/></a>
                    <a target="_blank" href="http://twitter.com/#!/Segundamanita_"><img alt="<?=$this->translate('Share on twitter');?>" src="/images/icons/ico_twitter.png" border = "0"/></a>
                </div>
                        
                <div class="span-24 last home_location_change">
                    <?php
                    //location change form
                    require_once APPLICATION_PATH . '/forms/LocationChange.php';
                    $form = new Form_LocationChange;
                    $form->setAction('/' . $this->lang . '/location/change');
                    $form->loadDefaultDecoratorsIsDisabled(false);
                    foreach ($form->getElements() as $element) {
                        $element->removeDecorator('DtDdWrapper');
                        $element->removeDecorator('Label');
                    }
                    //echo $form;
                    ?>

                    <div class="span-4 more_recent_ads">
                        <?php echo '<a class="select_more_recents" href="/">'.$this->translate('More recent ads').'</a>';?>
                    </div>
                    <div class="span-5 ad_create_tab ad_create_tab_home">
                        <?php echo '<a class="location" href="/'.$this->lang.'/location/change2/?location='. $this->escape($this->suggestIP).'" > '. $this->translate('In your city').'</a>';?>
                    </div>
                    <div class="span-4 all_ads">
                        <a class="select_all_ads" href='/<?= $this->lang ?>/ad/listall/ad_type/give'><?= $this->translate('All the ads'); ?></a>
                    </div>
                    <!-- <div class="span-5 organizations_ads">
                        <a class="select_organizations_ads" href='/<?= $this->lang ?>/ad/orgs'><?= $this->translate('Organizations and Campaigns'); ?></a>
                    </div> -->  
                    <div class="span-6 last select_language"></div>
                      <!-- <div class="span-11 last select_language">
                            <a href='javascript:void(0)'><img src='/images/icons/england.png' /></a>
                            <a href='javascript:void(0)'><img src='/images/icons/germany.png' /></a>
                            <a href='javascript:void(0)'><img src='/images/icons/brasil.png' /></a>
                      </div>  -->
                     
                </div>

            </div>

            <?= $this->layout()->content ?>

            <div id="footer" class="span-24 last">
                <div class="span-4">
                    <div class="copyright">
                        <div class="mark">segundamanita.com</div>
        
                        <div class="ecoeureka">ECOEUREKA S.L</div>
                        <div class="year"> </div>
                    </div>
                </div>
                <div class="span-9">
                    <div class="links-footer">
                      <a class="footerlink" href='/<?= $this->lang ?>/page/about'><?= $this->translate('About'); ?></a>
                      <hr />
                      <a class="footerlink" href='/<?= $this->lang ?>/page/help'><?= $this->translate('Help Segundito'); ?></a>
                      <hr />
                      <a class="footerlink" href='/<?= $this->lang ?>/page/privacy'><?= $this->translate('Privacy policy'); ?></a>
                      <hr />
                      <a class="footerlink" href='/<?= $this->lang ?>/contact'><?= $this->translate('Contact'); ?></a>
                      <!-- <hr />
                      <a class="footerlink" href='/<?= $this->lang ?>/page/organizations'><?= $this->translate('About organizations'); ?></a>
                      <hr />   -->  
                   </div>
              </div>
              <div id="info" class="span-11 last">
                  <p><?= $this->translate('footer_text'); ?></p>
                </div>
           </div>
        </div>
        <script type="text/javascript"></script>
    </body>
</html>
<? //=Zend_Version::VERSION; ?>
